import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.io.Reader;

public class Main {
    public static void main(String[] args) {
        Reader r = null;
        try {
            r = new FileReader("foodinfo.txt");
        }catch (IOException e){
            e.printStackTrace();
        }
        if(r!=null){
            BufferedReader br = new BufferedReader(r);
            try {
                String line = br.readLine();
                System.out.println("食物，每100克铁元素含量（毫克）");
                double max = 0.0;
                String maxName = "";
                while ((line = br.readLine()) != null){
                    String[] strs = line.split(",");
                    //strs[0],strs[1],strs[2],strs[3]
                    //strs[3]/strs[2]*100
                    int weight = Integer.parseInt(strs[2]);
                    double feWeight = Double.parseDouble(strs[3]);
                    double feWeightPer100 = feWeight/weight*100;
                    if(feWeightPer100 > max){
                        max = feWeightPer100;
                        maxName = strs[0];
                    }
                    System.out.println(strs[0] + "," +feWeightPer100);
                }
                System.out.println("单位重量含铁量最高的食物是"+maxName+"，每100克含有"+max+"毫克铁。");
            }catch (IOException e){
                e.printStackTrace();
            }

        }

    }
}